import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/home',
    name: 'LayoutUI',
    component: () => import('../layout/LayoutUI.vue')
  },
  {
    path: '/beiwang',
    name: 'LayoutUI2',
    component: () => import('../layout/LayoutUI2.vue')
  },
  {
    path: '/',
    redirect: '/login', // 重定向到 /login
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/LoginUI.vue')
  },
  {
    path: `/child/:id`,
    name: 'child',
    component: () => import('../layout/todolist.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/RegisterUI.vue')
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router